package com.huifer.wgx.model;

import com.fasterxml.jackson.annotation.JsonIgnore;
import java.math.BigDecimal;
import java.util.Collection;
import java.util.Objects;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 * <p>Title : InteriorPointEntity </p>
 * <p>Description : </p>
 *
 * @author huifer
 * @date 2019-03-20
 */
@Entity
@Table(name = "t_interior_point", schema = "at15", catalog = "")
public class InteriorPointEntity {

    private Long interiorPointId;
    private String interiorPointName;
    private BigDecimal interiorPointX;
    private BigDecimal interiorPointY;
    private BigDecimal interiorPointZ;
    private BigDecimal interiorPointDeep;
    private String interiorPointIsmesh;
    private String interiorPointSize;
    private String interiorPointManholeCoverType;
    private Long workId;
    private Long personnelId;
    private String pointType;
    private Collection<DetectionPointEntity> tDetectionPointsByInteriorPointId;
    private Collection<InteriorLineEntity> tInteriorLinesByInteriorPointId;
    private Collection<InteriorLineEntity> tInteriorLinesByInteriorPointId_0;
    private WorkEntity tWorkByWorkId;
    private PersonnelEntity tPersonnelByPersonnelId;
    private Collection<ResultLineAttrEntity> tResultLineAttrsByInteriorPointId;
    private Collection<ResultPointAttrEntity> tResultPointAttrsByInteriorPointId;

    @Basic
    @Column(name = "interior_point_type")
    public String getPointType() {
        return pointType;
    }

    public void setPointType(String pointType) {
        this.pointType = pointType;
    }

    @Id
    @Column(name = "interior_point_id")
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    public Long getInteriorPointId() {
        return interiorPointId;
    }

    public void setInteriorPointId(Long interiorPointId) {
        this.interiorPointId = interiorPointId;
    }

    @Basic
    @Column(name = "interior_point_name")
    public String getInteriorPointName() {
        return interiorPointName;
    }

    public void setInteriorPointName(String interiorPointName) {
        this.interiorPointName = interiorPointName;
    }

    @Basic
    @Column(name = "interior_point_x")
    public BigDecimal getInteriorPointX() {
        return interiorPointX;
    }

    public void setInteriorPointX(BigDecimal interiorPointX) {
        this.interiorPointX = interiorPointX;
    }

    @Basic
    @Column(name = "interior_point_y")
    public BigDecimal getInteriorPointY() {
        return interiorPointY;
    }

    public void setInteriorPointY(BigDecimal interiorPointY) {
        this.interiorPointY = interiorPointY;
    }

    @Basic
    @Column(name = "interior_point_z")
    public BigDecimal getInteriorPointZ() {
        return interiorPointZ;
    }

    public void setInteriorPointZ(BigDecimal interiorPointZ) {
        this.interiorPointZ = interiorPointZ;
    }

    @Basic
    @Column(name = "interior_point_deep")
    public BigDecimal getInteriorPointDeep() {
        return interiorPointDeep;
    }

    public void setInteriorPointDeep(BigDecimal interiorPointDeep) {
        this.interiorPointDeep = interiorPointDeep;
    }

    @Basic
    @Column(name = "interior_point_ismesh")
    public String getInteriorPointIsmesh() {
        return interiorPointIsmesh;
    }

    public void setInteriorPointIsmesh(String interiorPointIsmesh) {
        this.interiorPointIsmesh = interiorPointIsmesh;
    }

    @Basic
    @Column(name = "interior_point_size")
    public String getInteriorPointSize() {
        return interiorPointSize;
    }

    public void setInteriorPointSize(String interiorPointSize) {
        this.interiorPointSize = interiorPointSize;
    }

    @Basic
    @Column(name = "interior_point_manhole_cover_type")
    public String getInteriorPointManholeCoverType() {
        return interiorPointManholeCoverType;
    }

    public void setInteriorPointManholeCoverType(String interiorPointManholeCoverType) {
        this.interiorPointManholeCoverType = interiorPointManholeCoverType;
    }

    @Basic
    @Column(name = "work_id")
    public Long getWorkId() {
        return workId;
    }

    public void setWorkId(Long workId) {
        this.workId = workId;
    }

    @Basic
    @Column(name = "personnel_id")
    public Long getPersonnelId() {
        return personnelId;
    }

    public void setPersonnelId(Long personnelId) {
        this.personnelId = personnelId;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }
        InteriorPointEntity that = (InteriorPointEntity) o;
        return Objects.equals(interiorPointId, that.interiorPointId) &&
                Objects.equals(interiorPointName, that.interiorPointName) &&
                Objects.equals(interiorPointX, that.interiorPointX) &&
                Objects.equals(interiorPointY, that.interiorPointY) &&
                Objects.equals(interiorPointZ, that.interiorPointZ) &&
                Objects.equals(interiorPointDeep, that.interiorPointDeep) &&
                Objects.equals(interiorPointIsmesh, that.interiorPointIsmesh) &&
                Objects.equals(interiorPointSize, that.interiorPointSize) &&
                Objects
                        .equals(interiorPointManholeCoverType, that.interiorPointManholeCoverType)
                &&
                Objects.equals(workId, that.workId) &&
                Objects.equals(personnelId, that.personnelId);
    }

    @Override
    public int hashCode() {
        return Objects.hash(interiorPointId, interiorPointName, interiorPointX, interiorPointY,
                interiorPointZ, interiorPointDeep, interiorPointIsmesh, interiorPointSize,
                interiorPointManholeCoverType, workId, personnelId);
    }

    @OneToMany(mappedBy = "tInteriorPointByInteriorPointId")
    @JsonIgnore
    public Collection<DetectionPointEntity> gettDetectionPointsByInteriorPointId() {
        return tDetectionPointsByInteriorPointId;
    }

    public void settDetectionPointsByInteriorPointId(
            Collection<DetectionPointEntity> tDetectionPointsByInteriorPointId) {
        this.tDetectionPointsByInteriorPointId = tDetectionPointsByInteriorPointId;
    }

    @OneToMany(mappedBy = "tInteriorPointByInteriorLineStartPointId")
    @JsonIgnore
    public Collection<InteriorLineEntity> gettInteriorLinesByInteriorPointId() {
        return tInteriorLinesByInteriorPointId;
    }

    public void settInteriorLinesByInteriorPointId(
            Collection<InteriorLineEntity> tInteriorLinesByInteriorPointId) {
        this.tInteriorLinesByInteriorPointId = tInteriorLinesByInteriorPointId;
    }

    @OneToMany(mappedBy = "tInteriorPointByInteriorLineEndPointId")
    @JsonIgnore
    public Collection<InteriorLineEntity> gettInteriorLinesByInteriorPointId_0() {
        return tInteriorLinesByInteriorPointId_0;
    }

    public void settInteriorLinesByInteriorPointId_0(
            Collection<InteriorLineEntity> tInteriorLinesByInteriorPointId_0) {
        this.tInteriorLinesByInteriorPointId_0 = tInteriorLinesByInteriorPointId_0;
    }

    @ManyToOne
    @JoinColumn(name = "work_id", referencedColumnName = "work_id", insertable = false, updatable = false)
    public WorkEntity gettWorkByWorkId() {
        return tWorkByWorkId;
    }

    public void settWorkByWorkId(WorkEntity tWorkByWorkId) {
        this.tWorkByWorkId = tWorkByWorkId;
    }

    @ManyToOne
    @JoinColumn(name = "personnel_id", referencedColumnName = "personnel_id", insertable = false, updatable = false)
    public PersonnelEntity gettPersonnelByPersonnelId() {
        return tPersonnelByPersonnelId;
    }

    public void settPersonnelByPersonnelId(PersonnelEntity tPersonnelByPersonnelId) {
        this.tPersonnelByPersonnelId = tPersonnelByPersonnelId;
    }

    @OneToMany(mappedBy = "tInteriorPointByInteriorLineId")
    @JsonIgnore
    public Collection<ResultLineAttrEntity> gettResultLineAttrsByInteriorPointId() {
        return tResultLineAttrsByInteriorPointId;
    }

    public void settResultLineAttrsByInteriorPointId(
            Collection<ResultLineAttrEntity> tResultLineAttrsByInteriorPointId) {
        this.tResultLineAttrsByInteriorPointId = tResultLineAttrsByInteriorPointId;
    }

    @OneToMany(mappedBy = "tInteriorPointByInteriorPointId")
    @JsonIgnore
    public Collection<ResultPointAttrEntity> gettResultPointAttrsByInteriorPointId() {
        return tResultPointAttrsByInteriorPointId;
    }

    public void settResultPointAttrsByInteriorPointId(
            Collection<ResultPointAttrEntity> tResultPointAttrsByInteriorPointId) {
        this.tResultPointAttrsByInteriorPointId = tResultPointAttrsByInteriorPointId;
    }
}
